package model.collect;

public class bxbusDis {
	 //plate,code,line time,updown,station,label
	
	private String[] msgs;
	public bxbusDis(String msg){

		msgs = msg.split(";");
		for (int i = 0; i < msgs.length; i++) {
			String tmp = msgs[i];
			switch (i){
			case 0 :
				this.plate=tmp;
				break;
			case 1 :
				this.code=tmp;
				break;
			case 2:
				this.line=tmp;
				if (!this.line.contains("路")){
					this.line=this.line+"路";
				}
				break;
			case 3 :
				if (!tmp.equalsIgnoreCase("NULL")){
					this.time= Long.parseLong(tmp);
				}
				break;
			case 4 :
				if (!tmp.equalsIgnoreCase("NULL")){
					this.updown=Integer.parseInt(tmp);
				}
				break;
			case 5 :
				if (!tmp.equalsIgnoreCase("NULL")){
					this.station=Integer.parseInt(tmp);
				}
				break;
			case 6 :
				if (!tmp.equalsIgnoreCase("NULL")){
				    this.dislabel=Integer.parseInt(tmp);
				}
				break;
			
			}
			
		}	
	}
	public bxbusDis(String plate, String code, String line, long time,
			int updown, int station, int dislabel) {
		super();
		this.plate = plate;
		this.code = code;
		this.line = line;
		this.time = time;
		this.updown = updown;
		this.station = station;
		this.dislabel = dislabel;
	}
	private String plate;
	private String code;
	private String line;
	private long time;
	private int updown;
	private int station;
	private int dislabel;
	public String getPlate() {
		return plate;
	}
	public void setPlate(String plate) {
		this.plate = plate;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getLine() {
		return line;
	}
	public void setLine(String line) {
		this.line = line;
	}
	public long getTime() {
		return time;
	}
	public void setTime(long time) {
		this.time = time;
	}
	public int getUpdown() {
		return updown;
	}
	public void setUpdown(int updown) {
		this.updown = updown;
	}
	public int getStation() {
		return station;
	}
	public void setStation(int station) {
		this.station = station;
	}
	public int getDislabel() {
		return dislabel;
	}
	public void setDislabel(int dislabel) {
		this.dislabel = dislabel;
	}
}
